﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace AREQWinService
{
    static class AreqServiceProgram
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            if (Environment.UserInteractive)
            {
                AREQService host = new AREQService();
                host.StartService();

                ObjState TestObj = new ObjState();
                // TestObj.Filename = @"C:\Users\ccook\Dropbox\JetblueWorkFiles\Visual Studio 2008\AREQWinService\EmailTest.arq";
                TestObj.Filename = @"C:\Users\ccook\SharePoint\Cook III, Charles\JetblueWorkFiles\Visual Studio 2008\AREQWinService\EmailTest.arq";
                //  TestObj.Filename = @"C:\Users\ccook.JETBLUE\SkyDrive @ JetBlue Airways Corporation\JetblueWorkFiles\Visual Studio 2008\AREQWinService\ACARSTest.txt";
                //TestObj.Filename = @"C:\Users\ccook.JETBLUE\Dropbox\JetblueWorkFiles\Visual Studio 2008\AREQWinService\ACARSTest.txt";
                AREQService.CheckAcarsMonitorEmail();
                AREQService.ParseACMREQMessage(TestObj);

                Console.WriteLine("Service Debug Window");

                Console.ReadLine();
                //host.StopService();
               // host.Dispose();
            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] 
			{ 
				new AREQService() 
			};
                ServiceBase.Run(ServicesToRun);
            }
        }
    }

}
